﻿package loaders{
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.net.URLLoaderDataFormat;
	import flash.net.URLVariables;
	import flash.net.URLRequestMethod;
	import flash.events.Event;
	import flash.events.*;
	public class Retreuvak {
		//GOTTA DECLARE THEM VAIRABLES
		var varLoader:URLLoader;
		var thisRequest:URLRequest = new URLRequest();


		//this is where the loaded variables will go
		public var chararray=new Array([]);

		function retreuvak() {
			//Gotta know wtf it's asking for and recieving
			thisRequest=new URLRequest("http://www.jtworld.net/data_test.php");
			varLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
			thisRequest.method=URLRequestMethod.GET;

			//Event Listeners. Need them
			varLoader.addEventListener(Event.COMPLETE, completeHandler);

		}
		//Put the URL in here retreuvak.request(urlin)
		public function getRequest(urlIn:String) {
			thisRequest=new URLRequest(urlIn);
		}
		public function loadvars() {
			varLoader.load(thisRequest);
		}
		function completeHandler(eventObj:Event) {
			trace(eventObj.currentTarget.data);
			chararray=eventObj.currentTarget.data.chararray;
		}

	}

}